<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div [ngClass]="{
    'container-visible2': activeIndex !== 3,
    'container-hidden': activeIndex === 3
  }">
  <div class="aui-header-5">
    <h1>{{ 'common_init_config_label' | i18n }}</h1>
  </div>
  <div class="aui-block">
    <div class="init-content">
      <div class="header2">
        <span>{{ 'common_config_service_network_label' | i18n }}</span>
      </div>
      <lv-tabs [(lvActiveIndex)]="selectedTabIndex" (lvActiveIndexChange)="onChangeTab($event)">
        <lv-tab [lvId]="'backup'" [lvTitle]="'common_backup_network_config_label' | i18n">
          <aui-config-network-table serviceType="backup" [selectionData]="selectedData"></aui-config-network-table>
        </lv-tab>
        <lv-tab [lvId]="'replication'" [lvTitle]="'common_replication_network_label' | i18n">
          <aui-config-network-table serviceType="replication" [selectionData]="selectedData"></aui-config-network-table>
        </lv-tab>
        <lv-tab [lvId]="'archived'" [lvTitle]="'common_archived_network_config_label' | i18n">
          <aui-config-network-table serviceType="archived" [selectionData]="selectedData"></aui-config-network-table>
        </lv-tab>
      </lv-tabs>
    </div>
  
    <lv-group lvGutter="16px" class="init-button">
      <button lv-button lvType="primary" (click)="createInitConfig()"
        [ngClass]="{ visible: activeIndex !== 2, hidden: activeIndex === 2}"
        [disabled]="!(this.selectedData['backupValid'])"
        class="init-button-content">
        {{ 'common_ok_label' | i18n }}
      </button>
    </lv-group>
  </div>
</div>

<div [ngClass]="{
    'container-visible2': activeIndex === 3,
    'container-hidden': activeIndex !== 3
  }">
  <div class="aui-block">
    <aui-init-config-process [componentData]="componentData" (onResetChange)="onResetChange($event)">
    </aui-init-config-process>
  </div>
</div>